﻿<phone:PhoneApplicationPage
    x:Class="Catalogo.WindowsPhone.Views.ItemPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewmodel="clr-namespace:Catalogo.Portable.ViewModel;assembly=Catalogo.Portable"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <phone:PhoneApplicationPage.Resources>
        <viewmodel:ItemPageViewModel x:Key="ViewModel"/>
        <Style TargetType="Button" x:Key="EmptyButton">
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <ContentPresenter />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </phone:PhoneApplicationPage.Resources>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Assets/AppBar/share.png" Text="Compartilhar" Click="ShareButton_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Assets/AppBar/save.png" Text="Gravar Tag" Click="WriteTagButton_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
    
    <Grid x:Name="LayoutRoot">
        <phone:Panorama ItemsSource="{Binding Items}" x:Name="Panorama">
            <phone:Panorama.TitleTemplate>
                <DataTemplate>
                    <Border Background="#FF748181" Margin="-10,40,0,0">
                        <Image Source="/Assets/Images/Logo.png" Margin="40,0,0,0" Stretch="Uniform"/>
                    </Border>
                </DataTemplate>
            </phone:Panorama.TitleTemplate>
            <phone:Panorama.HeaderTemplate>
                <DataTemplate>
                </DataTemplate>
            </phone:Panorama.HeaderTemplate>
            <phone:PanoramaItem>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="80" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBlock Text="{Binding Item.Nome}" FontSize="40" TextWrapping="NoWrap" />
                    <Grid Grid.Row="1">
                        <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
                            <StackPanel VerticalAlignment="Top" Background="#99000000">
                                <Border Background="#99000000">
                                    <Image x:Name="image" Source="{Binding Item.ImageUrl}" Stretch="UniformToFill"/>
                                </Border>
                                <TextBlock Text="{Binding Item.SubTitulo}" FontSize="20"/>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock FontSize="20" FontFamily="Segoe UI" Text="R$ " VerticalAlignment="Bottom" Margin="0,0,3,0"/>
                                    <TextBlock  Text="{Binding Item.Valor}" TextWrapping="NoWrap" FontSize="20"  />
                                </StackPanel>
                            </StackPanel>
                        </ScrollViewer>
                    </Grid>
                </Grid>
            </phone:PanoramaItem>
            <phone:PanoramaItem>
                <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Margin="0,80,0,0">
                    <StackPanel Background="#99000000" VerticalAlignment="Top" >
                        <TextBlock Text="{Binding Item.Descricao}" TextWrapping="Wrap" Margin="6"/>
                    </StackPanel>
                </ScrollViewer>
            </phone:PanoramaItem>
        </phone:Panorama>
    </Grid>

</phone:PhoneApplicationPage>
